#include <stdio.h>

int main(int argc, const char *argv[])
{
	char buff[128] = {0};
	gets(buff);

	int big_count = 0;
	int small_count = 0;
	int num_count = 0;
	int other_count = 0;

	int i = 0;
	while(buff[i]){
		if(buff[i] >= 'A' && buff[i] <= 'Z'){
			big_count++;
		}else if(buff[i] >= 'a' && buff[i] <= 'z'){
			small_count++;
		}else if(buff[i] >= '0' && buff[i] <= '9'){
			num_count++;
		}else{
			other_count++;
		}
		i++;
	}
	printf("%d %d %d %d\n", big_count, small_count, num_count, other_count);

	return 0;
}
